home *** CD-ROM | disk | FTP | other *** search
/ MACD 5 / MACD 5.bin / workbench / libs / shutdown.lzh / shutdown_5.1 / src / queue / shutdown.h < prev   
C/C++ Source or Header  |  1996-11-28  |  2KB  |  80 lines

  1. /*
  2.    queue/shutdown.h --- shutdown queue definitions.
  3.  
  4.    (c) Copyright 1995 SHW Wabnitz
  5.    Written by Bernhard Fastenrath (fasten@shw.com)
  6.  
  7.    This file may be distributed under the terms
  8.    of the GNU General Public License.
  9. */
  10.  
  11. #ifndef QUEUE_SHUTDOWN_H
  12. #define QUEUE_SHUTDOWN_H
  13.  
  14. /* definitions for the sm_Status field:
  15.    SHUTDOWN_WARN:   system might go down
  16.    SHUTDOWN_INFO:   check sm_Info field
  17.    SHUTDOWN_ABORT:  shutdown cancelled
  18.    SHUTDOWN_NOW:    system is going down in a few seconds
  19.    SHUTDOWN_UMOUNT: accessing files is pointless from now on
  20.    SHUTDOWN_HALT:   the system is down
  21. */
  22. #define SHUTDOWN_WARN   0x01
  23. #define SHUTDOWN_INFO   0x02
  24. #define SHUTDOWN_ABORT  0x04
  25. #define SHUTDOWN_NOW    0x08
  26. #define SHUTDOWN_UMOUNT 0x10
  27. #define SHUTDOWN_HALT   0x20
  28.  
  29. /* definitions for the sm_Info field:
  30.    SDMI_UPS_MONITOR: UPS monitor report (sm_Extra points to struct UpsInfo)
  31. */
  32. #define SDMI_UPS_MONITOR 0x01
  33.  
  34. typedef struct {
  35.   ULONG    sm_Status;
  36.   ULONG    sm_TimeLeft;
  37.   ULONG    sm_Info;
  38.   void    *sm_Extra;
  39.   ULONG    sm_Reserved[2];
  40. } ShutdownMessage;
  41.  
  42. typedef struct UpsInfo {
  43.   ULONG ui_Event;
  44.   ULONG ui_Charge; /* Charge in percent */
  45.   ULONG ui_Time;   /* Remaining time    */
  46.   ULONG ui_Reserved[8];
  47. } UpsInfo;
  48.  
  49. #define UPS_EV_OKAY         0x00
  50. #define UPS_EV_LINE_FAIL    0x01
  51. #define UPS_EV_RECOVERY     0x02
  52. #define UPS_EV_BYPASS       0x03
  53. #define UPS_EV_NO_BYPASS    0x04
  54. #define UPS_EV_LOW_BATTERY  0x05
  55. #define UPS_EV_RECHARGED    0x06
  56. #define UPS_EV_SHUTDOWN_RECOMMENDED 0x07
  57. #define UPS_EV_SHORT_POWER_FAIL     0x08
  58. #define UPS_EV_FAULT        0x0a
  59. #define UPS_EV_NO_FAULT     0x0b
  60. #define UPS_EV_INVERTER     0x0c
  61. #define UPS_EV_NO_INVERTER  0x0d
  62. #define UPS_EV_SPECIAL_ON   0x0e
  63. #define UPS_EV_SPECIAL_OFF  0x0f
  64. #define UPS_EV_CONNECTION_LOST 0x11
  65. #define UPS_EV_CONNECTION_OKAY 0x12
  66. #define UPS_EV_MAX          0x12
  67.  
  68. #define UPS_EV_NAMES { \
  69.   "Okay", "Line Fail", "Recovery", \
  70.   "Bypass", "No Bypass", "Low Battery", \
  71.   "Recharged", "Shutdown Recommended", \
  72.   "Short Power Fail", "", \
  73.   "Fault",      "No Fault", \
  74.   "Inverter",   "No Inverter", \
  75.   "Special On", "Special Off", "", \
  76.   "Connection Lost", "Connection Restored" \
  77. }
  78.  
  79. #endif /* QUEUE_SHUTDOWN_H */
  80.